package com.huan.study.conf;

import lombok.Setter;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.cloud.netflix.feign.CodemaoFeignClientBeanListener;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
@ConditionalOnProperty(value = "codemao.feign.debug.services")
@ConfigurationProperties("codemao.feign.debug")
public class CodemaoFeignClientConfiguration {
    @Setter
    private String services;

    @Bean
    public CodemaoFeignClientBeanListener codemaoFeignClientBeanListener(){
        return new CodemaoFeignClientBeanListener(services);
    }
}
